﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VswService_V7.OPC.DB;
using VswService_V7.Utility;

namespace VswService_V7.DataBase.Tables
{
    public class STRIP_SQ
    {
		#region  field
		public static readonly string tableName = "STRIP_SQ";
		public static readonly string fd_stripNo = "STRIP_NO";
		public static readonly string fd_dtj = "DTJ";
		public static readonly string fd_updateTime = "UPDATE_TIME";
		public static readonly string fd_sq1 = "SQ1";
		public static readonly string fd_sq2 = "SQ2";
		public static readonly string fd_sq3 = "SQ3";
		public static readonly string fd_sq4 = "SQ4";
        #endregion


        /// <summary>
        /// Create the SQ part of the insert all into statement, only return sql string without catch
        /// </summary>
        /// <param name="stripNo"></param>
        /// <param name="position"></param>
        /// <param name="pd"></param>
        /// <returns></returns>
        public static string CreatInsertAllsql(string stripNo, string position, ProcessData pd)
        {
            string sql = string.Format("into {0}" +
                        "({1},{2},{3}," +
                        "{4},{5},{6},{7}) " +
                        "values('{8}','{9}','{10}'," +
                        "'{11}','{12}','{13}','{14}') ",
                        tableName,
                        fd_stripNo, fd_dtj, fd_updateTime,
                        fd_sq1, fd_sq2, fd_sq3, fd_sq4,
                        stripNo, position, pd.updateTime.ToString(Formats.GetLongFormat()),
                        pd.SQ_1, pd.SQ_2, pd.SQ_3, pd.SQ_4);
            return sql;
        }

    }
}
